<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="templateadmin.xhtml">
        <ui:define name="content">
            <c:if test="#{adminSearchBean.listFlight != null}">
                <center>
                    <h:form>
                        <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <!--                        <th class="table-header-repeat line-left minwidth-1" width="120px"><a href="">Flight ID</a>	</th>-->
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Flight Name</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Depart Time</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Arrival Time</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Depart Location</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Arrival Location</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Option</a></th>
                            </tr>
                            <ui:repeat value="#{adminSearchBean.listFlight}" var="flight">
                                <tr>
                                    <td>
                                        <h:inputText id="txtName" value="#{flight.flightName}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                        <br/>
                                        <h:message for="txtName" styleClass="error-inner" ></h:message>
                                    </td>
                                    <td>
                                        <h:inputText id="txtDeTime" value="#{flight.departTime}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                        <br/>
                                        <h:message for="txtDeTime" styleClass="error-inner"></h:message>
                                    </td>
                                    <td>
                                        <h:inputText id="txtArrTime" value="#{flight.arrTime}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                        <br/>
                                        <h:message for="txtArrTime" styleClass="error-inner"></h:message>
                                    </td>
                                    <td>
                                        <h:selectOneMenu value="#{flight.departLocal}" styleClass="styledselect_form_1">
                                            <f:selectItems value="#{mngFlightBean.listLocation}" var="local" itemValue="#{local.locationID}" itemLabel="#{local.locationName}"></f:selectItems>
                                        </h:selectOneMenu>
                                    </td>
                                    <td>
                                        <h:selectOneMenu value="#{flight.arrLocal}" styleClass="styledselect_form_1">
                                            <f:selectItems value="#{mngFlightBean.listLocation}" var="local" itemValue="#{local.locationID}" itemLabel="#{local.locationName}"></f:selectItems>
                                        </h:selectOneMenu>
                                    </td>
                                    <td>
                                        <h:commandButton action="#{mngFlightBean.updateFlightAction(flight)}" value="Update" styleClass="form-update" onclick="show_alert()"></h:commandButton>
                                    </td>
                                </tr>
                            </ui:repeat>
                        </table>
                    </h:form>
                </center>
            </c:if>

            <c:if test="#{adminSearchBean.listHotel != null}">
                <center>
                    <h:form id="form1">
                        <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-repeat line-left minwidth-1" width="30px"><a href="">Hotel ID</a>	</th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Place Name</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Hotel Name</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Rate</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Price</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Option</a></th>
                            </tr>
                            <ui:repeat value="#{adminSearchBean.listHotel}" var="hotel">
                                <tr>
                                    <td>#{hotel.hotelID}</td>
                                    <td><h:selectOneMenu value="#{hotel.placeID}" styleClass="styledselect_form_1">
                                            <f:selectItems value="#{mngHotelBean.listPlaces}" var="place" itemValue="#{place.placeID}" itemLabel="#{place.placeName}"></f:selectItems>
                                        </h:selectOneMenu>
                                    </td>
                                    <td><h:inputText id="txtName" value="#{hotel.hotelName}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                        <br/>
                                        <h:message for="txtName" styleClass="error-inner"></h:message>
                                    </td>
                                    <td>
                                        <h:selectOneMenu value="#{hotel.rate}" styleClass="styledselect_form_1">
                                            <f:selectItem itemValue="1"  itemLabel="1"></f:selectItem>
                                            <f:selectItem itemValue="2" itemLabel="2"></f:selectItem>
                                            <f:selectItem itemValue="3" itemLabel="3"></f:selectItem>
                                            <f:selectItem itemValue="4" itemLabel="4"></f:selectItem>
                                            <f:selectItem itemValue="5" itemLabel="5"></f:selectItem>
                                        </h:selectOneMenu>
                                    </td>
                                    <td><h:inputText id="txtPrice" value="#{hotel.price}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                        <br/>
                                        <h:message for="txtPrice" styleClass="error-inner"></h:message>
                                    </td>
                                    <td><h:commandButton action="#{mngHotelBean.updateHotelModelAction(hotel)}" value="Update" styleClass="form-update"></h:commandButton></td>
                                </tr>
                            </ui:repeat>
                        </table>
                    </h:form>
                </center>
            </c:if>

            <c:if test="#{adminSearchBean.listPKTour!= null}">
                <center>
                    <h:form id="formsearh">
                        <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-repeat line-left minwidth-1" width="10px"><a href="">Option</a>	</th>
                                <th class="table-header-repeat line-left minwidth-1" width="180px"><a href=""> Tour Name </a></th>

                                <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">From Date</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">End Date</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">Price</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Image</a></th>
                            </tr>
                            <ui:repeat value="#{adminSearchBean.listPKTour}" var="ltour">
                                <tr>
                                    <td><a href="detailpackagetour.xhtml?id=#{ltour.packageTourID}">Detail</a></td>
                                    <td>#{ltour.packageTourName}</td>
                                    <td>#{ltour.fdate}</td>
                                    <td>#{ltour.edate}</td>
                                    <td>#{ltour.price}</td>
                                    <td><img alt=""  src="#{ltour.images}" width="150" height="150"></img></td>
                                </tr>
                            </ui:repeat>
                        </table>
                    </h:form>
                </center>
            </c:if>
            <c:if test="#{adminSearchBean.listTourByState!= null}">
                <h:form id="formsearh12">
                    <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                        <tr>
                            <th class="table-header-repeat line-left minwidth-1" width="10px"><a href="">Option</a>	</th>
                            <th class="table-header-repeat line-left minwidth-1" width="180px"><a href=""> Tour Name </a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">From Date</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">End Date</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">Price</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Image</a></th>
                        </tr>
                        <ui:repeat value="#{adminSearchBean.listTourByState}" var="ltour">
                            <tr>
                                <td><a href="detailpackagetour.xhtml?id=#{ltour.packageTourID}">Detail</a></td>
                                <td>#{ltour.packageTourName}</td>
                                <td>#{ltour.fdate}</td>
                                <td>#{ltour.edate}</td>
                                <td>#{ltour.price}</td>
                                <td><img alt=""  src="#{ltour.images}" width="150" height="150"></img></td>
                            </tr>
                        </ui:repeat>
                    </table>
                </h:form>
            </c:if>
            <c:if test="#{adminSearchBean.listCarDetail != null}">
                <h:form>
                    <center>
                        <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-repeat line-left minwidth-1" width="70px"><a href="">Model Name</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="90px"><a href="">Car Name</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="80px"><a href="">Description</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="30px"><a href="">Capacity</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Images</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="40px"><a href="">Price</a></th>
                                <th class="table-header-repeat line-left minwidth-1" width="70px"><a href="">Option</a></th>
                            </tr>
                            <ui:repeat value="#{adminSearchBean.listCarDetail}" var="lcar">
                                <tr>
                                    <td>
                                        <!-- select menu list all model car -->
                                        <h:selectOneMenu value="#{lcar.modelID}">
                                            <f:selectItems value="#{carDetailBean.lmodel}" var="lm" itemLabel="#{lm.modelName}" itemValue="#{lm.modelID}"></f:selectItems>
                                        </h:selectOneMenu>
                                    </td>
                                    <td><h:inputText value="#{lcar.carName}"  styleClass="inp-form12"></h:inputText></td>
                                    <td><h:inputText value="#{lcar.description}" styleClass="inp-form12"></h:inputText></td>
                                    <td><h:inputText value="#{lcar.capacity}" styleClass="inp-form12" id="txtcapa" required="true"></h:inputText></td>
                                    <td><img src="#{lcar.images}" width="80" height="80" alt=""></img></td>
                                    <td><h:inputText value="#{lcar.price}" styleClass="inp-form12"  id="txtprice" required="true"></h:inputText></td>
                                    <td><h:commandButton action="#{carDetailBean.updateCarDetail(lcar)}" value="Update" styleClass="form-update"></h:commandButton></td>
                                </tr>
                            </ui:repeat>
                        </table>
                    </center>
                </h:form>
            </c:if>

            <c:if test="#{adminSearchBean.listTourBookingDetail!=null}">
                <h:form id="tourbooking">

                    <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                        <tr>
                            <th class="table-header-repeat line-left minwidth-1" width="70px"><a href="">UserName </a></th>

                            <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">Package Name</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="80px"><a href="">Quantity</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Total Price</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="80px"><a href="">Available</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="10px"><a href="">Option</a>	</th>
                        </tr>
                        <ui:repeat value="#{adminSearchBean.listTourBookingDetail}" var="ltour">
                            <tr>
                                <td>#{ltour.usernames}</td>
                                <td>#{ltour.packagenames}</td>
                                <td>#{ltour.tourBooking.quantity}</td>
                                <td>#{ltour.tourBooking.price}</td>
                                <td>#{ltour.tourBooking.available}
                                </td>
                                <td>
                                    <h:commandButton action="#{mngTourBookingBean.updateStatusBooking(ltour.tourBooking)}"  styleClass="form-delay" onclick="show_confirm()"></h:commandButton>
                                </td>
                            </tr>
                        </ui:repeat>
                    </table>
                </h:form>

            </c:if>
        </ui:define>
    </ui:composition>
</html>

